/*
 * $Id: WowArmoryException.java 4 2007-12-20 21:20:26Z aaron.day $
 */
package org.crazydays.wowarmory;


/**
 * WowArmoryException
 */
public class WowArmoryException
	extends Exception
{
	/** page */
	protected IPage page;

	/** status */
	protected int status;

	/**
	 * WowArmoryException constructor.
	 */
	public WowArmoryException()
	{
	}

	/**
	 * WowArmoryException constructor.
	 *
	 * @param message Message
	 */
	public WowArmoryException(String message)
	{
		super(message);
	}

	/**
	 * WowArmoryException constructor.
	 *
	 * @param cause Cause
	 */
	public WowArmoryException(Throwable cause)
	{
		super(cause);
	}

	/**
	 * WowArmoryException constructor.
	 *
	 * @param message Message
	 * @param cause Cause
	 */
	public WowArmoryException(String message, Throwable cause)
	{
		super(message, cause);
	}

	/**
	 * Set page.
	 *
	 * @param page Page
	 * @return WowArmoryException
	 */
	public WowArmoryException setPage(IPage page)
	{
		this.page = page;

		return this;
	}

	/**
	 * Get page.
	 *
	 * @return Page
	 */
	public IPage getPage()
	{
		return page;
	}

	/**
	 * Set status.
	 *
	 * @param status Status
	 * @return WowArmoryException
	 */
	public WowArmoryException setStatus(int status)
	{
		this.status = status;

		return this;
	}

	/**
	 * Get status.
	 *
	 * @return Status
	 */
	public int getStatus()
	{
		return status;
	}

	/**
	 * ToString.
	 *
	 * @return String
	 * @see Object#toString()
	 */
	public String toString()
	{
		StringBuffer buffer = new StringBuffer();

		buffer.append(super.toString());

		IPage page = getPage();
		if (page != null) {
			buffer.append(" Page: ");
			buffer.append(page);
		}

		int status = getStatus();
		if (status != 0) {
			buffer.append(" Status: ");
			buffer.append(status);
		}

		return buffer.toString();
	}
}
